package com.yida.gwj.common.config;

import org.springframework.context.annotation.Bean;

import io.minio.MinioClient;

/**
 * Minio 配置信息
 *
 * @author yida
 */
// @Configuration
// @ConfigurationProperties(prefix = "minio")
public class MinioConfig {
    /**
     * 服务地址
     */
    private String url = "http://192.168.2.97:9000";

    /**
     * 用户名
     */
    private String accessKey = "eda";

    /**
     * 密码
     */
    private String secretKey = "D1CzLTvIiM97JeE2";

    /**
     * 存储桶名称
     */
    private String bucketName = "testfile1";

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getBucketName() {
        return bucketName;
    }

    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }

    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder().endpoint(url).credentials(accessKey, secretKey).build();
    }
}
